//
//  ActivityListCell.m
//  SXH
//
//  Created by Ryan on 15/12/10.
//  Copyright © 2015年 lyss. All rights reserved.
//

#import "ActivityListCell.h"
#import "UIImageView+AFNetworking.h"
#import "NSDate+WQCalendarLogic.h"
@implementation ActivityListCell

- (void)awakeFromNib {
    // Initialization code
    self.backgroundColor = [UIColor clearColor];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(ActivityHeadInfoModel *)model
{
    _model = model;
    [self.mainImage setImageWithURL:[NSURL URLWithString:IMAGE_STRING(model.album_thumb)]];

    if (model.surplus_day.intValue < 0)
    {
        self.startLabel.text = @"大赛还有";
        self.daysLabel.text = [NSString stringWithFormat:@"%d",ABS(model.surplus_day.intValue)];
        self.endLabel.text = @"天开始";
    }
    if (model.surplus_day.intValue == 0)
    {
        self.startLabel.text = @"活动已结束";
        self.daysLabel.text = @"";
        self.endLabel.text = @"";
    }
    if (model.surplus_day.intValue > 0)
    {
        self.startLabel.text = @"大赛还有";
        self.daysLabel.text = [NSString stringWithFormat:@"%@",model.surplus_day];
        self.endLabel.text = @"天结束";
    }
    
}


@end
